package summer_vacation.cullen.four10;

import java.util.Scanner;

/**
 * Created by Cullen on 2015/8/13.
 */
public class N41 {
    public static void main(String[] args) {
        System.out.print("a，b值为：");
        Scanner cin=new Scanner(System.in );
        int a=cin.nextInt();
        int b=cin.nextInt();
        int gys=GCD(a,b);
        int gbs=a*b/gys;
        System.out.print("最大公约数："+gys+" "+"最小公倍数:"+gbs);
    }
    public static int GCD(int a,int b)
    {
        int g=0;
        int min=a;
        if(a>b) min=b;
        for(int i=min-1;i>0;i--)
        {
            if(a%i==0&&b%i==0)
            {g=i;
                break;}
        }
        return g;

    }
}
